<?php
namespace app\common\lib;

class ClassArr
{

    public static function smsClessStat()
    {
        return [
            'ali' => 'app\common\lib\sms\AliSms',
            'tcloud' => 'app\common\lib\sms\TCloudSms'
        ];
    }

    public static function initClass($type , $cless, $params = [], $needInstance = false)
    {
        if (!array_key_exists($type, $cless)) {
            return false;
        }
        $className = $cless[$type];
        return $needInstance == true ? (new \ReflectionClass($className))->newInstanceArgs($params) : $className;
    }
}